//package org.dialMsg.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
///**
// * @author DPF
// */
//@Configuration
//@EnableAsync
//public class AsyncConfig implements WebMvcConfigurer {
//
//    @Override
//    public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
//        // 配置任务执行器
//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//        executor.setCorePoolSize(5);
//        executor.setMaxPoolSize(20);
//        executor.setQueueCapacity(100);
//        executor.setThreadNamePrefix("async-executor-");
//        executor.initialize();
//
//        configurer.setTaskExecutor(executor);
//        // 设置异步请求超时时间（毫秒）
//        configurer.setDefaultTimeout(50);
//    }
//}
